import { defHttp } from '@/apis/http'
import type { CommonAPI } from '@/apis/schema/all'
/**
 * @description: 授权
 */

/** 获取授权信息 */
export const getApiLicenseDetailApi: CommonAPI<'/api/license', 'get'> = (
  params
) => defHttp.get(`/api/license`, { params })

/** 绑定授权 */
export const postApiLicenseBindApi: CommonAPI<'/api/license/bind', 'post'> = (
  data
) => defHttp.post(`/api/license/bind`, { data })

/** 刷新授权 */
export const postApiLicenseRefreshApi: CommonAPI<
  '/api/license/refresh',
  'post'
> = (data) => defHttp.post(`/api/license/refresh`, { data })

/** 换绑授权 */
export const postApiLicenseReplaceBindApi: CommonAPI<
  '/api/license/replace-bind',
  'post'
> = (data) => defHttp.post(`/api/license/replace-bind`, { data })

/** 解绑授权 */
export const postApiLicenseUnbindApi: CommonAPI<
  '/api/license/unbind',
  'post'
> = (data) => defHttp.post(`/api/license/unbind`, { data })
